var Request = function(body) {
	this.class = 'Request';
	this.version = body.version || 0;
	this.game = body.id || "";
	this.payload = body.payload || [];

};

Request.prototype.toXML = function() {
	// <request version="1.0" id="589a39591271844e3fbe32bbb9281ad9">
	var xml = '<request version="' + this.version + '" id="' + this.game
			+ '">"\r\n';

	var length = this.payload.length;
	for ( var i = 0; i < length; i++) {
		xml += this.payload[i].toXML() + "\r\n";
	}

	xml += '</request>';

	return xml;
};

module.exports = Request;
